function modify_bar(stru_grid)
fold=fopen('bar.bdf','r');
fnew=fopen('bar+.bdf','w');
while feof(fold)==0
    entry=fgetl(fold);
    if length(entry)<2
        continue
    end
    if abs(stru_grid(sscanf(entry(25:32),'%d'),2)-stru_grid(sscanf(entry(33:40),'%d'),2))+abs(stru_grid(sscanf(entry(25:32),'%d'),3)-stru_grid(sscanf(entry(33:40),'%d'),3))<5
        entry(49:64)=' 1.      0.     ';
    end
    fprintf(fnew,'%s\n',entry);
end
fclose('all');
!del bar.bdf
!rename bar+.bdf bar.bdf
end